<include file="float/themes/web/Float/header.html" />

<div class="set">
	<div>
		<div  class="set1 gray"> 验证身份 </div>
			<span  class="set2"></span>
		<div  class="set1 orange"> 设置邮箱 </div>
			<span  class="set2"></span>
		<div  class="set1 gray"> 设置完成 </div>
	</div>
</div>

<div class="form">
        <form  name="codeform" id="codeform"  action="{:U('Binding/email_success')}" method="POST">
              <div>请输入你要设置的邮箱</div>
              <div>
                    <div></div>   
                    <input  name="email" id="email" type="text" placeholder="请输入邮箱"/> 
              </div>
              <div class="yzm">
                    <div></div>
                    <input  name="code" id="code" type="text" placeholder="请输入邮箱的验证码"/>
                    <div class="getcode">获取验证码</div>
              </div>
		        <div id="msg_box">
		<!--             <div class="err1"><span>原密码错误，请重新填写!!</span></div>
		            <div class="err2"><span>两次密码输入不一致或不能为空！！</span></div> -->
		        </div>
              <input type="button" value="确定" class="form1">
        </form>
</div>

</body>
<script src="__PUBLIC__/float/js/jquery.js"></script>
<script src="__PUBLIC__/float/js/main.js"></script>
<script src="__PUBLIC__/float/js/float.js"></script>
<script>
	$(function  () {
		var url ="{:U('Binding/verify_emailsend')}";
		var email;
	  	$(".getcode").click (
  			function f2(){
  				email = $('#email').val();
  	  			if(!checkEmail(email)){
  	  				showmsg("邮箱格式不正确,请重新输入");
  	  				return false;
  	  			}
  	  			$("#msg_box").css("display","none");
	  	  		var form_data = {
	  	  			email: email,
	  	  		};
  				_getCode(url,form_data,this,120,f2,1000)
		})
	})
    var btn1=document.querySelector(".form1");
	var vurl ="{:U('Binding/verifyemailcode')}";
	var vemail;
	var vcode;
    btn1.onclick=function(){
    	vemail = $('#email').val();
    	vcode = $('#code').val();
    	$("#msg_box").css("display","none");
    	console.log(vemail);
		if(!checkEmail(vemail)){
			showmsg("请重新输入邮箱");
			return;
		}
		
		if('' == vcode){
			showmsg("请输入验证码");
			return;
		}
			
		var form_data = {
			email: vemail,
			code: vcode,
		};
		sendDate(vurl,form_data,succ,err,"POST","JSON");
    }
</script>
 </html>